Fractale Tree  0.5
Plot Tree Fractale
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
QWidget_Graphique Class Reference

#include <qwidget_graphique.h>

Inheritance diagram for QWidget_Graphique:
Inheritance graph
[legend]
Collaboration diagram for QWidget_Graphique:
Collaboration graph
[legend]

Public Slots

void Button_color_clicked ()
 
void Update_Etat ()
 

Signals

void Value_changed ()
 

Public Member Functions

 QWidget_Graphique (QWidget *parent=0)
 
QColor Get_Color ()
 
void Set_Color (QColor color)
 
bool Get_with_Bout ()
 
void Set_with_Bout (bool etat)
 
bool Get_Color_Auto ()
 
void Set_Color_Auto (bool etat)
 

Private Attributes

QGridLayout * layout
 
QLabel * Label_bout
 
QPushButton * PushButton_Color
 
QCheckBox * CheckBox_Color
 
QRadioButton * RadioButton_Bout_with
 
QRadioButton * RadioButton_Bout_without
 
QColor Color
 

Detailed Description

Definition at line 28 of file qwidget_graphique.h.

Constructor & Destructor Documentation

◆ QWidget_Graphique()

QWidget_Graphique::QWidget_Graphique ( QWidget *  parent = 0)
explicit

Definition at line 3 of file qwidget_graphique.cpp.

References Button_color_clicked(), CheckBox_Color, Color, layout, PushButton_Color, RadioButton_Bout_with, RadioButton_Bout_without, Set_Color(), Update_Etat(), and Value_changed().

3  : QWidget(parent)
4 {
5 
6 
7  // Init
8  CheckBox_Color= new QCheckBox("Couleur automatique");
9  PushButton_Color = new QPushButton("COLOR");
10  RadioButton_Bout_with = new QRadioButton("Avec bout rond");
11  RadioButton_Bout_with->setChecked(true);
12  RadioButton_Bout_without = new QRadioButton("Sans bout rond");
13 
14  //HBoxLayou_graphique
15  QGridLayout *HBoxLayou_graphique = new QGridLayout;
16  HBoxLayou_graphique->addWidget(CheckBox_Color,1,1);
17  HBoxLayou_graphique->addWidget(PushButton_Color,2,1);
18 
19  HBoxLayou_graphique->addWidget(RadioButton_Bout_with,1,2);
20  HBoxLayou_graphique->addWidget(RadioButton_Bout_without,2,2);
21 
22  // QGroupBox_graphique
23  QGroupBox *QGroupBox_graphique = new QGroupBox(tr("Graphique"));
24  QGroupBox_graphique->setLayout(HBoxLayou_graphique);
25 
26  layout = new QGridLayout();
27  layout->addWidget(QGroupBox_graphique,1,1);
28  this->setLayout(layout);
29 
30  QObject::connect(RadioButton_Bout_with,SIGNAL(clicked(bool)),this,SIGNAL(Value_changed()));
31  QObject::connect(RadioButton_Bout_without,SIGNAL(clicked(bool)),this,SIGNAL(Value_changed()));
32 
33  QObject::connect(CheckBox_Color,SIGNAL(stateChanged(int)),this,SIGNAL(Value_changed()));
34 
35  QObject::connect(PushButton_Color,SIGNAL(clicked(bool)),this,SIGNAL(Value_changed()));
36  QObject::connect(PushButton_Color,SIGNAL(clicked(bool)),this,SLOT(Button_color_clicked()));
37 
38  QObject::connect(this,SIGNAL(Value_changed()),this,SLOT(Update_Etat()));
39 
40  Color.setRgb(254,0,0);
42 }
QCheckBox * CheckBox_Color
QRadioButton * RadioButton_Bout_without
QPushButton * PushButton_Color
QRadioButton * RadioButton_Bout_with
QGridLayout * layout
void Set_Color(QColor color)
Here is the call graph for this function:

Member Function Documentation

◆ Button_color_clicked

void QWidget_Graphique::Button_color_clicked ( )
slot

Definition at line 44 of file qwidget_graphique.cpp.

References Color, and Set_Color().

Referenced by QWidget_Graphique().

45 {
46  Color = QColorDialog::getColor(Color, this);
48 }
void Set_Color(QColor color)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Color()

QColor QWidget_Graphique::Get_Color ( )

Definition at line 57 of file qwidget_graphique.cpp.

References Color.

Referenced by Draw_Tree::Plot(), and Main_fenetre::Save_file().

58 {
59  return Color;
60 }
Here is the caller graph for this function:

◆ Get_Color_Auto()

bool QWidget_Graphique::Get_Color_Auto ( )

Definition at line 81 of file qwidget_graphique.cpp.

References CheckBox_Color.

Referenced by Draw_Tree::Plot(), and Main_fenetre::Save_file().

82 {
83  return CheckBox_Color->isChecked();
84 }
QCheckBox * CheckBox_Color
Here is the caller graph for this function:

◆ Get_with_Bout()

bool QWidget_Graphique::Get_with_Bout ( )

Definition at line 71 of file qwidget_graphique.cpp.

References RadioButton_Bout_with.

Referenced by Draw_Tree::Plot(), and Main_fenetre::Save_file().

72 {
73  return RadioButton_Bout_with->isChecked();
74 }
QRadioButton * RadioButton_Bout_with
Here is the caller graph for this function:

◆ Set_Color()

void QWidget_Graphique::Set_Color ( QColor  color)

Definition at line 62 of file qwidget_graphique.cpp.

References Color, and PushButton_Color.

Referenced by Button_color_clicked(), Main_fenetre::Open_file(), and QWidget_Graphique().

63 {
64  Color=color;
65 
66  QPalette palette;
67  palette.setColor(QPalette::ButtonText, Color);
68  PushButton_Color->setPalette(palette);
69 }
QPushButton * PushButton_Color
Here is the caller graph for this function:

◆ Set_Color_Auto()

void QWidget_Graphique::Set_Color_Auto ( bool  etat)

Definition at line 86 of file qwidget_graphique.cpp.

References CheckBox_Color.

Referenced by Main_fenetre::Open_file().

87 {
88  CheckBox_Color->setChecked(etat);
89 }
QCheckBox * CheckBox_Color
Here is the caller graph for this function:

◆ Set_with_Bout()

void QWidget_Graphique::Set_with_Bout ( bool  etat)

Definition at line 76 of file qwidget_graphique.cpp.

References RadioButton_Bout_with.

Referenced by Main_fenetre::Open_file().

77 {
78  RadioButton_Bout_with->setChecked(etat);
79 }
QRadioButton * RadioButton_Bout_with
Here is the caller graph for this function:

◆ Update_Etat

void QWidget_Graphique::Update_Etat ( )
slot

Definition at line 50 of file qwidget_graphique.cpp.

References CheckBox_Color, and PushButton_Color.

Referenced by QWidget_Graphique().

51 {
52  PushButton_Color->setEnabled(!CheckBox_Color->isChecked());
53 }
QCheckBox * CheckBox_Color
QPushButton * PushButton_Color
Here is the caller graph for this function:

◆ Value_changed

void QWidget_Graphique::Value_changed ( )
signal

Referenced by QWidget_Graphique().

Here is the caller graph for this function:

Member Data Documentation

◆ CheckBox_Color

QCheckBox* QWidget_Graphique::CheckBox_Color
private

Definition at line 53 of file qwidget_graphique.h.

Referenced by Get_Color_Auto(), QWidget_Graphique(), Set_Color_Auto(), and Update_Etat().

◆ Color

QColor QWidget_Graphique::Color
private

Definition at line 56 of file qwidget_graphique.h.

Referenced by Button_color_clicked(), Get_Color(), QWidget_Graphique(), and Set_Color().

◆ Label_bout

QLabel* QWidget_Graphique::Label_bout
private

Definition at line 50 of file qwidget_graphique.h.

◆ layout

QGridLayout* QWidget_Graphique::layout
private

Definition at line 48 of file qwidget_graphique.h.

Referenced by QWidget_Graphique().

◆ PushButton_Color

QPushButton* QWidget_Graphique::PushButton_Color
private

Definition at line 51 of file qwidget_graphique.h.

Referenced by QWidget_Graphique(), Set_Color(), and Update_Etat().

◆ RadioButton_Bout_with

QRadioButton* QWidget_Graphique::RadioButton_Bout_with
private

Definition at line 54 of file qwidget_graphique.h.

Referenced by Get_with_Bout(), QWidget_Graphique(), and Set_with_Bout().

◆ RadioButton_Bout_without

QRadioButton* QWidget_Graphique::RadioButton_Bout_without
private

Definition at line 55 of file qwidget_graphique.h.

Referenced by QWidget_Graphique().


The documentation for this class was generated from the following files: